#
# GerikSpell.py
# Created by Gerikes for GerikSpells

import CvUtil
from CvPythonExtensions import *

gc = CyGlobalContext()

class GerikSpellBase:
    def __init__(self):
        self.m_eSpell = -1
        self.m_pCastingGroup = None
        self.m_pCastingPlot = None

    def getSpellNumber(self):
        return self.m_eSpell

    def setSpellNumber(self, eSpell):
        self.m_eSpell = eSpell

    def getCastingGroup(self):
        return self.m_pCastingGroup

    def setCastingGroup(self, pGroup):
        self.m_pCastingGroup = pGroup

    def getCastingPlot(self):
        return self.m_pCastingPlot

    def setCastingPlot(self, pPlot):
        self.m_pCastingPlot = pPlot

    def startSpell(self, pSelectionGroup, pCastingPlot, bAlt, bShift, bCtrl):
        self.setCastingGroup(pSelectionGroup)
        self.setCastingPlot(pCastingPlot)
        self.start(bAlt, bShift, bCtrl)

    def getHelpText(self, pSelectedGroup, pPlot):
        return "" # Return "" to return the default text found in the XML.

    def getUnitHelpText(self, pUnit, bOneLine, bShort):
        return "" # Return "" to return the default text found in the XML.

    def pushSpellMission(self, iData1, iData2, iFlags):
        """
        Arguments:
        iData1: The generic integer data1
        iData2: The generic integer data2
        iData3: The generic integer data3
        iFlags: Interface flags

        Returns:
        none

        This is used when you wish to push a spell's mission. Using this rather than the pushMission will ensure
        that the spell's number is inserted into the internal data structure used to store missions (if the
        spell number is not there, it's impossible to tell what spell is being cast when the mission is
        at the top of the queue).

        See http://gerikspells.pbwiki.com/pushSpellMission for use of this function.
        """
        gc.pushSpellMission(self.getSpellNumber(), iData1, iData2, iFlags)

    def pushSpellMissionAltShift(self, iData1, iData2, iFlags, bAlt, bShift):
        """
        Arguments:
        iData1: The generic integer data1
        iData2: The generic integer data2
        iData3: The generic integer data3
        iFlags: Interface flags
        bAlt: If the "alt" key is pressed.
        bShift: If the "shift" key is pressed (actually, used for appending missions to queue)

        Returns:
        none
        """
        gc.pushSpellMissionAltShift(self.getSpellNumber(), iData1, iData2, iFlags, bAlt, bShift)
        

    
